import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
const routes: RouteRecordRaw[] = [
  {
    path: "/",
    name: "home",
    redirect: "/welcome",
    component: () => import("../views/home.vue"),
    children: [
      {
        path: "/user",
        name: "user",
        meta: { title: "用户管理" },
        component: () => import("../pages/user.vue"),
      },
      {
        path: "/menu",
        name: "menu",
        meta: { title: "菜单管理" },
        component: () => import("../pages/menu.vue"),
      },
      {
        path: "/role",
        name: "role",
        meta: { title: "角色管理" },
        component: () => import("../pages/role.vue"),
      },
      {
        path: "/welcome",
        name: "welcome",
        meta: { title: "欢迎" },
        component: () => import("../pages/welcome.vue"),
      },
      {
        path: "/dept",
        name: "dept",
        meta: { title: "部门管理" },
        component: () => import("../pages/dept.vue"),
      },
      {
        path: "/leave",
        name: "leave",
        meta: { title: "休假审批" },
        component: () => import("../pages/leave.vue"),
      },
      {
        path: "/approve",
        name: "approve",
        meta: { title: "待审批管理" },
        component: () => import("../pages/approve.vue"),
      }
    ],
  },
  {
    path: "/login",
    name: "login",
    component: () => import("../views/login.vue"),
  },
];
const router = createRouter({
  history: createWebHashHistory(),
  routes,
});
export default router;
